
function popUpSelectSurgeryService(selector,title,mess,iconType,buttons,focusButton){
	generalDialog(selector,title,null,null,{
		autoOpen: true,			
		bgiframe: true,
		resizable: true,		
		width: 720,
		height: 500,
		modal: true,
		buttons:buttons
	});
}

function showGroup(parentId){
	var currentGroup = $('.selected-group');
	if(currentGroup.length != 0){
		currentGroup.removeClass('selected-group');
		currentGroup.addClass('group');
	}
	$('.group-div').hide();
	$("[parent='" + parentId + "']").show();
}

function showService(groupId){
	$('.service').hide();
	$("[group='" + groupId + "']").show();
	var currentGroup = $('.selected-group');
	if(currentGroup.length > 0){
		currentGroup.removeClass('selected-group');
		currentGroup.addClass('group');
	}
	$('#' + groupId).removeClass('group');
	$('#' + groupId).addClass('selected-group');
	var currentSelectSurgery = $('.selected');
	if(currentSelectSurgery.length > 0){
		currentSelectSurgery.removeClass('selected');
		currentSelectSurgery.addClass('unselected');
	}
}

function resetSelectSurgeryDialog(){
	$('.group-div').hide();
	$('.service').hide();
	var currentSelectGroup = $('.selected-group');
	if(currentSelectGroup.length > 0){
		currentSelectGroup.removeClass('selected-group');
		currentSelectGroup.addClass('group');
	}
	var currentSelectSurgery = $('.selected');
	if(currentSelectSurgery.length > 0){
		currentSelectSurgery.removeClass('selected');
		currentSelectSurgery.addClass('unselected');
	}
}

function setSelected(service_id){
	var currentSelect = $('.selected');
	if(currentSelect.length > 0){
		currentSelect.removeClass('selected');
		currentSelect.addClass('unselected');
	}
	$('#' + service_id).removeClass('unselected');
	$('#' + service_id).addClass('selected');
}

function getSelectedSurgeryName(){
	var currentSelect = $('.selected');
	if(currentSelect.length > 0){
		return $.trim(currentSelect.text());
	}
}

function getSelectedSurgeryId(){
	var currentSelect = $('.selected');
	if(currentSelect.length > 0){
		return currentSelect.attr('id');
	}
}

// get information about type of surgery: major surgery, minor surgery...
function getSelectedSurgeryType(){
	var currentSelect = $('.selected');
	if(currentSelect.length > 0){
		return currentSelect.attr('surType');
	}
}

// get service catergory: whether service is surgery or ectomy 
function getSelectedSurgeryCatergoryId(){
	var currentSelectGroup = $('.selected-group');
	if(currentSelectGroup.length > 0){
		return currentSelectGroup.attr('parentId');
	}
	else
		return 0;
}

function getSelectedSurgeryCatergoryName(){
	id = getSelectedSurgeryCatergoryId();
	if(id > 0){
		return $.trim($(".catergory[id='" + id + "']").text());
	}
}